from pydantic import BaseModel,Field

class StudentSchema(BaseModel):
    id: int
    name: str
    gender: str
    clas_id: int
    model_config = {'from_attributes': True}   # 配置运行转换orm

class StudentCreate(BaseModel):
    name: str
    gender: str
    clas_id: int

class StudentUpdate(BaseModel):
    name: str
    gender: str
    clas_id: int
    model_config = {'from_attributes': True}